package com.day1012.afternoon;

public class TextR {
    public static void main(String[] args) {
        //MyRunnable myRunnable = new MyRunnable();
        //   lambda表达式
        Thread thread = new Thread( () ->{
        for (int i = 0; i < 50; i++) {
                System.out.println("线程名" + Thread.currentThread().getName() + ":" + i);
                try {
                    Thread.sleep(200);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        thread.start();

        for (int i = 0; i < 50; i++) {
            System.out.println("线程名" + Thread.currentThread().getName() + ":" + i);
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
